<?php
if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );

class Tablog extends CI_Controller {
	
	function __construct() {
		parent::__construct ();
	
	}
	
	public function index() {
		
		$id = (int)$this->uri->segment(2);
		if(!isset($id) || $id == ''){
			$this->load->view('error');
			return ;
		}
		//该会员的信息
		$this->db->select('*');
		$this->db->from('member');
		$this->db->where('id',$id);
		$eData['tamember'] = $this->db->get()->row_array();
		
		$ePage = ( int ) $this->input->get ('page' );
		$this->db->where('member',$id);
		$this->db->limit(10,$ePage);
		$blogList = $this->db->get('blog')->result_array();
		$eData['blogList'] = $blogList;
		$this->db->where('member',$id);
		$eData ['blogCount'] = $this->db->count_all_results( 'blog' );
		$this->load->library ( 'pagination' );
		$eConfig ['per_page'] = 10;
		$eConfig ['num_links'] = 5;
		$eConfig ['base_url'] = site_url ( 'tablog/'.$id.'?1=1');
		$eConfig ['total_rows'] = $eData ['blogCount'];
		$eConfig ['first_link'] = false;
		$eConfig ['last_link'] = false;
		$eConfig ['next_link'] = '下一页';
		$eConfig ['next_tag_open'] = '<li>';
		$eConfig ['next_tag_close'] = '</li>';
		$eConfig ['prev_link'] = '上一页';
		$eConfig ['prev_tag_open'] = '<li>';
		$eConfig ['prev_tag_close'] = '</li>';
		$eConfig ['num_tag_open'] = '<li>';
		$eConfig ['num_tag_close'] = '</li>';
		$eConfig ['cur_tag_open'] = '<li class="current"><a href="#">';
		$eConfig ['cur_tag_close'] = '</a></li>';
		$this->pagination->initialize ( $eConfig );
		
		
		$this->load->view('tablog',$eData);
	}
	
}

